
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>inelpl_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>inelpl_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void inelpl_c ( ConstSpiceEllipse  * ellips,
                   ConstSpicePlane    * plane,
                   SpiceInt           * nxpts,
                   SpiceDouble          xpt1[3],
                   SpiceDouble          xpt2[3] ) 
</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
   Find the intersection of an ellipse and a plane. 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
   <a href="../req/ellipses.html">ELLIPSES</a> 
   <a href="../req/planes.html">PLANES</a> 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
   ELLIPSE 
   GEOMETRY 
   MATH 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
   Variable  I/O  Description 
   --------  ---  -------------------------------------------------- 
   ellips     I   A CSPICE ellipse. 
   plane      I   A CSPICE plane. 
   nxpts      O   Number of intersection points of plane and ellipse. 
   xpt1, 
   xpt2       O   Intersection points. 
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   ellips         is a CSPICE ellipse. The ellipse is allowed to 
                  be degenerate: one or both semi-axes may have
                  zero length.
 
   plane          is a CSPICE plane.  The intersection of plane
                  and ellipse is sought.
 </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   nxpts          is the number of points of intersection of the
                  geometric plane and ellipse represented by `plane' and
                  `ellips'. `nxpts' may take the values 0, 1, 2 or -1.
                  The value -1 indicates that the ellipse consists of
                  more than one point lies in the plane, so the number
                  of intersection points is infinite.

                  When the ellipse consists of a single point and
                  lies in the plane, `nxpts' is set to 1.
 
   xpt1, 
   xpt2           are the points of intersection of the input plane 
                  and ellipse. If there is only one intersection 
                  point, both xpt1 and xpt2 contain that point. If 
                  the number of intersection points is zero or 
                  infinite, the contents of xpt1 and xpt2 are 
                  undefined. 
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   1)  The input plane must be a CSPICE plane: the normal vector must
       be non-zero and the constant must be non-negative.
       If the input plane is invalid, the error SPICE(INVALIDPLANE)
       will be signaled.

   2)  If the input ellipse has non-orthogonal axes, the error
       SPICE(INVALIDELLIPSE) will be signaled.

   3)  The input ellipse is allowed to be a line segment or a point;
       these cases are not considered to be errors. If the ellipse
       consists of a single point and lies in the plane, the number
       of intersection points is set to 1 (rather than -1) and
       the output arguments `xpt1' and `xpt2' are assigned the value
       of the ellipse's center.
 </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
  
   This routine computes the intersection set of a non-degenerate
   plane with a possibly degenerate ellipse. The ellipse is allowed
   to consist of a line segment or a point.

   A plane may intersect an ellipse in 0, 1, 2, or infinitely many
   points. For there to be an infinite set of intersection points,
   the ellipse must lie in the plane and consist of more than one
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
   1)  If we want to find the angle of some ray above the limb of an 
       ellipsoid, where the angle is measured in a plane containing 
       the ray and a &quot;down&quot; vector, we can follow the procedure 
       given below.  We assume the ray does not intersect the 
       ellipsoid.  The result we seek is called angle, imaginatively 
       enough. 
 
       We assume that all vectors are given in body-fixed 
       coordinates. 
 
          #include &quot;SpiceUsr.h&quot;
              .
              .
              .
     /.
     Find the limb of the ellipsoid as seen from the 
     point observ.  Here a, b, and c are the lengths of 
     the semi-axes of the ellipsoid.  The limb is  
     returned as a SpiceEllipse.
     ./

     <a href="edlimb_c.html">edlimb_c</a> ( a, b, c, observ, &amp;limb ); 

     /.
     The ray direction vector is raydir, so the ray is the 
     set of points 
           
        observ  +  t * raydir 

     where t is any non-negative real number. 

     The `down' vector is just -observ.  The vectors 
     observ and raydir are spanning vectors for the plane 
     we're interested in.  We can use <a href="psv2pl_c.html">psv2pl_c</a> to represent 
     this plane by a CSPICE plane. 
     ./
     <a href="psv2pl_c.html">psv2pl_c</a> ( observ, observ, raydir, &amp;plane );
 
     /.
     Find the intersection of the plane defined by observ 
     and raydir with the limb. 
     ./
     <b>inelpl_c</b> ( limb, plane, nxpts, xpt1, xpt2 ); 
 
     /.
     We always expect two intersection points, if the vector
     down is valid. 
     ./ 
     if ( nxpts &lt; 2 )
     {
        [ do something about the error ] 
     } 

     /.
     Form the vectors from observ to the intersection 
     points.  Find the angular separation between the 
     boresight ray and each vector from observ to the 
     intersection points. 
     ./
     <a href="vsub_c.html">vsub_c</a>   ( xpt1, observ, vec1 ); 
     <a href="vsub_c.html">vsub_c</a>   ( xpt2, observ, vec2 );

     sep1 = <a href="vsep_c.html">vsep_c</a> ( vec1, raydir ); 
     sep2 = <a href="vsep_c.html">vsep_c</a> ( vec2, raydir ); 
 
     /.
     The angular separation we're after is the minimum of 
     the two separations we've computed. 
     ./
     angle = <a href="mind_c.html">mind_c</a> ( 2, sep1, sep2 ); 

 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
   N.J. Bachman   (JPL) 
 </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
 
   -CSPICE Version 2.0.0, 14-JAN-2008 (NJB)
 
      Bug fix: the routine's specification and behavior have been
      updated so the routine now returns a meaningful result for the
      case of an ellipse consisting of a single point.

      Bug fix: in the degenerate case where the input ellipse is a
      line segment of positive length, and this segment intersects
      the plane, the number of intersection points is set to 1
      rather than 2.

      Invalid input planes and ellipses are now diagnosed.

   -CSPICE Version 1.0.0, 28-AUG-2001 (NJB)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   intersection of ellipse and plane 
 </PRE>
<h4>Link to routine inelpl_c source file <a href='../../../src/cspice/inelpl_c.c'>inelpl_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:25 2010</pre>

</body>
</html>

